<template>
  <view>
    <u-navbar title="我的足迹" back-icon-size="34" title-size="36" :border-bottom="false" :background="background" title-color="#333" back-icon-color="#333"></u-navbar>
    <view class="" v-for="(i, k) in list" :key="k">
      <view class="" style="padding: 38rpx 32rpx; font-size: 30rpx">
        {{ i.create_time }}
      </view>
      <!-- 药品区 -->
      <view class="" style="display: flex; align-items: center; flex-wrap: wrap">
        <view
          class=""
          style="width: 44.6%; border-radius: 20rpx; background: #fff; padding-bottom: 28rpx; margin-top: 24rpx; margin-left: 28rpx"
          v-for="m in i.goods"
          @tap="detail(m.goods_id)"
        >
          <image :src="img_url + m.goods_image" mode="aspectFill" style="width: 100%; height: 335rpx; border-radius: 20rpx"></image>
          <view class="" style="font-size: 28rpx; padding: 0 10rpx">
            {{ m.goods_name }}
          </view>
          <view class="" style="display: flex; align-items: center; justify-content: space-between; padding: 0 10rpx">
            <view class="" style="color: #e50014">
              <text style="font-size: 24rpx">￥</text>
              <text style="font-size: 36rpx">{{ m.specs_price.split('.')[0] }}.</text>
              <text style="font-size: 24rpx">{{ m.specs_price.split('.')[1] }}</text>
            </view>
            <view class="" style="font-size: 24rpx; color: #666">已售{{ m.seles }}件</view>
          </view>
          <view
            class=""
            style="
              width: 106rpx;
              text-align: center;
              line-height: 36rpx;
              font-size: 22rpx;
              color: #e50014;
              height: 36rpx;
              background: #ffedee;
              border-radius: 4rpx;
              margin-left: 15rpx;
            "
          >
            {{ m.label_text }}
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: '',
  data() {
    return {
      background: {
        background: '#fff'
      },
      list: []
    };
  },
  //方法
  methods: {
    foot() {
      this.api({
        url: '/api/shop/footMark',
        method: 'post'
      }).then((res) => {
        this.list = res.data;
      });
    },
    detail(e) {
      this.api({
        url: '/api/shop/goodsDetails',
        method: 'post',
        data: {
          goods_id: e
        }
      }).then((res) => {
        uni.navigateTo({
          url: '/shop/shopdetail/shopdetail?id=' + e
        });
      });
    }
  },
  //首页渲染
  onLoad(options) {
    this.foot();
  },
  //监听
  watch: {},
  //计算属性
  computed: {}
};
</script>

<style lang="scss" scoped>
page {
  background: #f8f8f8;
}
</style>
